package net.gaox.search.search.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.gaox.search.search.vo.feature.DistrictFeature;
import net.gaox.search.search.vo.feature.FeatureRelation;
import net.gaox.search.search.vo.feature.ItFeature;
import net.gaox.search.search.vo.feature.KeywordFeature;
import net.gaox.search.search.vo.media.AdSlot;
import net.gaox.search.search.vo.media.App;
import net.gaox.search.search.vo.media.Device;
import net.gaox.search.search.vo.media.Geo;

import java.util.List;

/**
 * <p> 广告搜索请求对象 </p>
 *
 * @author gaox·Eric
 * @site gaox.net
 * @date 2019/12/20 16:18
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SearchRequest {

    // 媒体方的请求标识
    private String mediaId;
    // 请求基本信息
    private RequestInfo requestInfo;
    // 匹配信息
    private FeatureInfo featureInfo;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class RequestInfo {
        /**
         * 请求标识
         */
        private String requestId;
        /**
         * 广告位信息
         */
        private List<AdSlot> adSlots;
        /**
         * App 信息
         */
        private App app;
        /**
         * 地理位置信息
         */
        private Geo geo;
        /**
         * 设备信息
         */
        private Device device;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class FeatureInfo {
        /**
         * 关键词
         */
        private KeywordFeature keywordFeature;
        /**
         * 地域
         */
        private DistrictFeature districtFeature;
        /**
         * 兴趣
         */
        private ItFeature itFeature;
        /**
         * 匹配关系
         */
        private FeatureRelation relation = FeatureRelation.AND;
    }
}
